﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;
using IceDog.DNL.CSharp.Grammar.ClassInstantiation;
using IceDog.DNL.CSharp.Model;
using Newtonsoft.Json;

namespace IceDog.DNL.CSharp.MSTest
{
    /// <summary>
    /// 类实例化测试
    /// </summary>
    [TestClass]
    public class ClassInstantiationUnitTest
    {

        /// <summary>
        /// City类的实例化方式
        /// </summary>
        [TestMethod]
        public void TestMethod1()
        {
            var cityManager = new CityManager();
            var city1 = new City();
            var city2 = City.Create();
            var city3 = cityManager.GetCity(city1);
            var city4 = cityManager.GetCity<City>();
            var list = JsonConvert.SerializeObject(new[] {city1, city2, city3, city4},Formatting.Indented);
            Console.WriteLine(list);
        }

        /// <summary>
        /// 
        /// </summary>
        [TestMethod]
        public void TestMethodX()
        {

        }
    }
}
